<admintpl file="headerEx"/>
<link href="__PUBLIC__/js/artDialog/skins/default.css" rel="stylesheet" />
<title>{:L('WEB_SITE_INFOS')}</title>
<!--responsive table-->
<link href="__PUBLIC__/TciocEx/css/table-responsive.css" rel="stylesheet"/>
<!--ios7-->
<link rel="stylesheet" type="text/css" href="__PUBLIC__/TciocEx/js/ios-switch/switchery.css" />

<!--icheck-->
<link href="__PUBLIC__/TciocEx/js/iCheck/skins/minimal/minimal.css" rel="stylesheet">
<link href="__PUBLIC__/TciocEx/js/iCheck/skins/minimal/red.css" rel="stylesheet">
<link href="__PUBLIC__/TciocEx/js/iCheck/skins/minimal/green.css" rel="stylesheet">
</head>
<body class="sticky-header">
<section>
	<!-- main content start-->
	<div class="full-content">
		<!-- body wrapper start -->
		<div class="wrapper">
			<div class="row">
				<div class="col-sm-12">
					<section class="panel">
						<header class="panel-heading custom-tab turquoise-tab">
							<ul class="nav nav-tabs">
								<li class="active"><a href="#A" data-toggle="tab"><i class="fa fa-list-ul"></i> {:L('WEB_SITE_INFOS')}</a></li>
								<li><a href="#B" data-toggle="tab"><i class="fa fa-list-alt"></i> {:L('SEO_SETTING')}</a></li>
								<li><a href="#C" data-toggle="tab"><i class="fa fa-list-alt"></i> {:L('URL_SETTING')}</a></li>
								<li><a href="{:U('route/index')}"><i class="fa fa-list-alt"></i> {:L('URL_OPTIMIZATION')}</a></li>
								<!-- <li><a href="#D" data-toggle="tab">{:L('UCENTER_SETTING')}</a></li> -->
								<li><a href="#E" data-toggle="tab"><i class="fa fa-list-alt"></i> {:L('COMMENT_SETTING')}</a></li>
								<li><a href="#F" data-toggle="tab"><i class="fa fa-list-alt"></i> {:L("USERNAME_FILTER")}</a></li>
								<li><a href="#G" data-toggle="tab"><i class="fa fa-list-alt"></i> CDN设置</a></li>
								<li><a href="#SMS" data-toggle="tab"><i class="fa fa-list-alt"></i> 短信设置</a></li>
							</ul>
						</header>
						<div class="panel-body">
							<div class=" form">
								<form class="cmxform form-horizontal adminex-form js-ajax-form" id="commentForm" method="post" action="{:U('setting/site_post')}"      novalidate="novalidate" enctype="multipart/form-data">
									<fieldset>
										<div class="tabbable">
											<div class="tab-content">
												<div class="tab-pane active" id="A">
													<fieldset>
														<div class="form-group">
															<label for="site_name" class="control-label col-lg-2">{:L('WEBSITE_NAME')}(*)</label>
															<div class="col-lg-10">
																<input  class=" form-control" id="site_name" type="text" name="options[site_name]" value="{$site_name}">
																<php>if($option_id):</php>
																<input type="hidden" name="option_id" value="{$option_id}">
																<php>endif;</php>
															</div>
														</div>
														<div class="form-group">
															<label for="js-site-admin-url-password" class="control-label col-lg-2">后台地址加密码(*)</label>
															<div class="col-lg-10">
																<input type="text" class=" form-control"    name="options[site_admin_url_password]" value="{$site_admin_url_password}" id="js-site-admin-url-password">
																<span class="help-block" style="color: red;">设置加密码后必须通过以下地址访问后台,请劳记此地址，为了安全，您也可以定期更换此加密码!</span>
																<php>$site_admin_url_password =C("SP_SITE_ADMIN_URL_PASSWORD");</php>
																<if condition="!empty($site_admin_url_password)">
																	<span class="help-block">后台地址：<span id="js-site-admin-url">{:sp_get_host()}__ROOT__?g=admin&upw={:C('SP_SITE_ADMIN_URL_PASSWORD')}</span></span>
																</if>
															</div>
														</div>
														<div class="form-group">
															<label  for="site_tpl" class="control-label col-lg-2" >{:L('WEBSITE_THEME')}</label>
															<div>
																&nbsp;<select name="options[site_tpl]" id="site_tpl"   class="input-lg"  style="padding: 5px 16px;height: auto"   >
																	<foreach name="templates"  item="vo">
																		<php>$tpl_selected=$site_tpl==$vo?"selected":"";</php>
																		<option value="{$vo}" {$tpl_selected}>{$vo}</option>
																	</foreach>
																</select>
															</div>
														</div>
														<div class="form-group">
															<label  class="control-label col-lg-2">{:L('ENABLE_MOBILE_THEME')}</label>
															<div class="col-lg-10">
																<php>$mobile_tpl_enabled_checked=empty($mobile_tpl_enabled)?'':'checked';</php>
																<label class="checkbox inline"><input type="checkbox"  name="options[mobile_tpl_enabled]" value="1" {$mobile_tpl_enabled_checked}></label>
															</div>
														</div>
														<div class="form-group">
															<label for="site_adminstyle" class="control-label col-lg-2" >{:L('WEBSITE_ADMIN_THEME')}</label>
															<div >
																<php>$site_adminstyle=empty($site_adminstyle)?'flat':$site_adminstyle;</php>
																&nbsp;<select name="options[site_adminstyle]"  id="site_adminstyle"  class="input-lg"  style="padding: 5px 16px;height: auto">
																	<foreach name="adminstyles" item="vo">
																		<php>$adminstyle_selected=$site_adminstyle==$vo?"selected":"";</php>
																		<option value="{$vo}" {$adminstyle_selected}>{$vo}</option>
																	</foreach>
																</select>
															</div>
														</div>
														<div class="form-group">
															<label class="control-label col-lg-2" >{:L('HTML_CACHE')}</label>
															<div class="col-lg-10">
																<php>$html_cache_on_checked=empty($html_cache_on)?'':'checked';</php>
																<label class="checkbox inline"><input type="checkbox" name="options[html_cache_on]" value="1" {$html_cache_on_checked}></label>
															</div>
														</div>
														<div class="form-group">
															<label for="site_icp" class="control-label col-lg-2" >{:L('WEBSITE_ICP')}</label>
															<div class="col-lg-10">
																<input type="text" id="site_icp" class="form-control" name="options[site_icp]" value="{$site_icp}">
															</div>
														</div>
														<div class="form-group">
															<label for="site_admin_email" class="control-label col-lg-2" >{:L('WEBMASTER_EMAIL')}</label>
															<div class="col-lg-10">
																<input type="text" name="options[site_admin_email]"  id="site_admin_email" class="form-control" value="{$site_admin_email}">
															</div>
														</div>
														<div class="form-group">
															<label for="site_tongji" class="control-label col-lg-2" >{:L("WEBSITE_STATISTICAL_CODE")}</label>
															<div class="col-lg-10">
																<textarea class=" form-control" id="site_tongji" name="options[site_tongji]" rows="5" cols="57">{$site_tongji}</textarea>
															</div>
														</div>
														<div class="form-group">
															<label  for="site_copyright"  class="control-label col-lg-2" >{:L('WEBSITE_COPYRIGHT_INFOMATION')}</label>
															<div class="col-lg-10">
																<textarea  class=" form-control" id="site_copyright" name="options[site_copyright]" rows="5" cols="57">{$site_copyright}</textarea>
															</div>
														</div>
													</fieldset>
												</div>
												<div class="tab-pane" id="B">
													<fieldset>
														<div class="form-group">
															<label  for="site_seo_title"  class="control-label col-lg-2" >{:L('WEBSITE_SEO_TITLE')}</label>
															<div class="col-lg-10">
																<input type="text" name="options[site_seo_title]" id="site_seo_title" class="form-control" value="{$site_seo_title}">
															</div>
														</div>
														<div class="form-group">
															<label  for="site_seo_keywords"  class="control-label col-lg-2"  >{:L('WEBSITE_SEO_KEYWORDS')}</label>
															<div class="col-lg-10">
																<input type="text" name="options[site_seo_keywords]"   id="site_seo_keywords" class="form-control"   value="{$site_seo_keywords}">
															</div>
														</div>
														<div class="form-group">
															<label  for="site_seo_description" class="control-label col-lg-2">{:L('WEBSITE_SEO_DESCRIPTION')}</label>
															<div class="col-lg-10">
																<textarea  class=" form-control" id="site_seo_description" name="options[site_seo_description]" rows="5" cols="57">{$site_seo_description}</textarea>
															</div>
														</div>
													</fieldset>
												</div>
												<div class="tab-pane" id="C">
													<fieldset>
														<div class="form-group">
															<label   for="urlmode" class="control-label col-lg-2" >{:L('URL_MODE')}</label>
															<div>
																<php>$urlmodes=array( "0"=>L('URL_NORMAL_MODE'), "1"=>L('URL_PATHINFO_MODE'), "2"=>L('URL_REWRITE_MODE'));</php>
																&nbsp;<select name="options[urlmode]" id="urlmode" class=" input-lg "  style="padding: 5px 16px;height: auto">
																	<foreach name="urlmodes" item="vo">
																		<php>$urlmode_selected=$key==$urlmode?"selected":"";</php>
																		<option value="{$key}" {$urlmode_selected}>{$vo}</option>
																	</foreach>
																</select>
																<span class="form-required">* {:L('URL_MODE_HELP_TEXT')}</span>
															</div>
														</div>
														<div class="form-group">
															<label  for="html_suffix" class="control-label col-lg-2"  >{:L('URL_REWRITE_SUFFIX')}</label>
															<div class="col-lg-10">
																<input type="text" name="options[html_suffix]"    id="html_suffix" class="form-control"   value="{$html_suffix}">
																<span class="form-required">{:L('URL_REWRITE_SUFFIX_HELP_TEXT')}</span>
															</div>
														</div>
													</fieldset>
												</div>
												<div class="tab-pane" id="E">
													<fieldset>
														<div class="form-group">
															<label  for="comment_need_check" class="control-label col-lg-2" >{:L('COMMENT_CHECK')}</label>
															<div class="col-lg-10">
																<php>$comment_need_checked=empty($comment_need_check)?"":"checked";</php>
																<input type="checkbox"  class="js-check " id="comment_need_check"   name="options[comment_need_check]" value="1" {$comment_need_checked}>
															</div>
														</div>
														<div class="form-group">
															<label  for="comment_time_interval" class="control-label col-lg-2"  >{:L('COMMENT_TIME_INTERVAL')}</label>
															<div class="col-lg-10">
																<input type="number" name="options[comment_time_interval]"   id="comment_time_interval"  style="border-radius: 6px; padding: 5px;text-align: center;"   value="{$comment_time_interval|default=60}" ><span>{:L('SECONDS')}</span>
															</div>
														</div>
													</fieldset>
												</div>
												<div class="tab-pane" id="F">
													<fieldset>
														<div   class="form-group"  >
															<label  for="banned_usernames"  class="control-label col-lg-2">{:L('SPECAIL_USERNAME')}</label>
															<div class="col-lg-10">
																<textarea class=" form-control"  id="banned_usernames" name="cmf_settings[banned_usernames]" rows="5" cols="57">{$cmf_settings.banned_usernames}</textarea>
															</div>
														</div>
													</fieldset>
												</div>
												<div class="tab-pane" id="G">
													<fieldset>
														<div  class="form-group" >
															<label  for="cdn_static_root" class="control-label col-lg-2" >静态资源cdn地址</label>
															<div class="col-lg-10">
																<input type="text" class=" form-control"  id="cdn_static_root" name="cdn_settings[cdn_static_root]" value="{$cdn_settings.cdn_static_root}">
										<span class="help-block">
											不能以/结尾；设置这个地址后，请将ThinkCMF下的静态资源文件放在其下面；<br>
											ThinkCMF下的静态资源文件大致包含以下(如果你自定义后，请自行增加)：<br>
											admin/themes/simplebootx/Public/assets<br>
											public<br>
											themes/simplebootx/Public/assets<br>
											例如未设置cdn前：jquery的访问地址是/public/js/jquery.js, 设置cdn是后它的访问地址就是：静态资源cdn地址+/public/js/jquery.js

										</span>
															</div>
														</div>
													</fieldset>
												</div>
												<div class="tab-pane" id="SMS">
													<fieldset>
														<div class="form-group">
															<label  class="control-label col-lg-2" for="sms_status">是否开启短信</label>
															<div class="col-lg-10">
																<input type="checkbox"  id="sms_status" name="sms_settings[status]" value="{$sms_settings.status}" <if condition="$sms_settings['status'] eq 1">checked </if>   >
															</div>
														</div>
														<div class="form-group">
															<label class="control-label col-lg-2" for="sms_userid">企业id</label>
															<div class="col-lg-10">
																<input type="number"  class=" form-control"  id="sms_userid" name="sms_settings[userid]" value="{$sms_settings.userid}"  >
																<span> 登陆平台后，“客户管理”&gt; “我的信息”&gt; 企业ID </span>
															</div>
														</div>
														<div class="form-group">
															<label class="control-label col-lg-2" for="sms_host">短信平台域名</label>
															<div class="col-lg-10">
																<input type="text" class=" form-control" id="sms_host" name="sms_settings[host]" value="{$sms_settings.host}"  placeholder="如：http://www.abc.com/">
																<span> 末尾必须加上“/”号 </span>
															</div>
														</div>
														<div class="form-group">
															<label class="control-label col-lg-2 " for="sms_api">短信发送接口</label>
															<div class="col-lg-10">
																<input type="text" class=" form-control" id="sms_api" name="sms_settings[send]" value="{$sms_settings.send}"  >
																<span> 一般可以不修改 </span>
															</div>
														</div>
														<div class="form-group">
															<label class="control-label  col-lg-2" for="sms_account">平台账号</label>
															<div class="col-lg-10">
																<input type="text"  class=" form-control"  id="sms_account" name="sms_settings[account]" value="{$sms_settings.account}"  >
															</div>
														</div>
														<div class="form-group">
															<label class="control-label col-lg-2" for="sms_pwd">账号密码</label>
															<div class="col-lg-10">
																<input type="password"  class=" form-control" id="sms_pwd" name="sms_settings[pwd]" value="{$sms_settings.pwd}"  >
															</div>
														</div>
														<div class="form-group">
															<label class="control-label col-lg-2 " for="sms_signstr">短信签名内容</label>
															<div class="col-lg-10">
																<input type="text"  class=" form-control" id="sms_signstr" name="sms_settings[signstr]" value="{$sms_settings.signstr}"  >
																<span> 短信签名设置，如“千峰云科技”，则发送的短信自动带有 "【千峰云科技】"为头的内容 </span>
															</div>
														</div>
													</fieldset>
												</div>
											</div>
										</div>
										<div class="form-group">
											<div class="col-md-12 text-center clearfix" style="width: auto; padding-left: 25%;padding-top: 20px;">
												<button class="btn btn-primary js-ajax-submit" type="submit">{:L('SAVE')}</button>
												<a href="javascript:history.back(-1);" class="btn btn-default">{:L('BACK')}</a>
											</div>
										</div>
									</fieldset>
								</form>
							</div>

						</div>
					</section>

				</div>
			</div>
		</div>
		<!--footer section start-->
		<footer>
			<admintpl file="copyright"/>
		</footer>
		<!--footer section end-->
	</div>
	<!-- main content end-->
</section>
<script src="__PUBLIC__/TciocEx/js/jquery-1.10.2.min.js"></script>
<script src="__PUBLIC__/js/wind.js"></script>
<script src="__PUBLIC__/js/common.js"></script>
<script src="__PUBLIC__/TciocEx/js/jquery-ui-1.9.2.custom.min.js"></script>
<script src="__PUBLIC__/simpleboot/bootstrap/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/jquery-migrate-1.2.1.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/modernizr.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/jquery.nicescroll.js"></script>
<script src="__PUBLIC__/js/ajaxForm.js"></script>

<script type="text/javascript" src="__PUBLIC__/TciocEx/js/jquery.validate.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/validation-localization/messages_zh.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/scripts.js"></script>
<script src="__PUBLIC__/TciocEx/js/validation-init.js"></script>
<script>
	/////---------------------
	$(function(){
		$("#urlmode-select").change(function(){
			if($(this).val()==1){
				alert("更改后，若发现前台链接不能正常访问，可能是您的服务器不支持PATHINFO，请先修改data/conf/config.php文件的URL_MODEL为0保证网站正常运行,在配置服务器PATHINFO功能后再更新为PATHINFO模式！");
			}

			if($(this).val()==2){
				alert("更改后，若发现前台链接不能正常访问，可能是您的服务器不支持REWRITE，请先修改data/conf/config.php文件的URL_MODEL为0保证网站正常运行，在开启服务器REWRITE功能后再更新为REWRITE模式！");
			}
		});
		$("#js-site-admin-url-password").change(function(){
			$(this).data("changed",true);
		});
	});
	Wind.use('validate', 'ajaxForm', 'artDialog', function() {
		//javascript
		var form = $('form.js-ajax-forms');
		//ie处理placeholder提交问题
		if ($.browser && $.browser.msie) {
			form.find('[placeholder]').each(function() {
				var input = $(this);
				if (input.val() == input.attr('placeholder')) {
					input.val('');
				}
			});
		}
		//表单验证开始
		form.validate({
			//是否在获取焦点时验证
			onfocusout : false,
			//是否在敲击键盘时验证
			onkeyup : false,
			//当鼠标掉级时验证
			onclick : false,
			//验证错误
			showErrors : function(errorMap, errorArr) {
				//errorMap {'name':'错误信息'}
				//errorArr [{'message':'错误信息',element:({})}]
				try {
					$(errorArr[0].element).focus();
					art.dialog({
						id : 'error',
						icon : 'error',
						lock : true,
						fixed : true,
						background : "#CCCCCC",
						opacity : 0,
						content : errorArr[0].message,
						cancelVal : "{:L('OK')}",
						cancel : function() {
							$(errorArr[0].element).focus();
						}
					});
				} catch (err) {
				}
			},
			//验证规则
			rules : {
				'options[site_name]' : {
					required : 1
				},
				'options[site_host]' : {
					required : 1
				},
				'options[site_root]' : {
					required : 1
				}
			},
			//验证未通过提示消息
			messages : {
				'options[site_name]' : {
					required : "{:L('WEBSITE_SITE_NAME_REQUIRED_MESSAGE')}"
				},
				'options[site_host]' : {
					required : "{:L('WEBSITE_SITE_HOST_REQUIRED_MESSAGE')}"
				}
			},
			//给未通过验证的元素加效果,闪烁等
			highlight : false,
			//是否在获取焦点时验证
			onfocusout : false,
			//验证通过，提交表单
			submitHandler : function(forms) {
				$(forms).ajaxSubmit({
					url : form.attr('action'), //按钮上是否自定义提交地址(多按钮情况)
					dataType : 'json',
					beforeSubmit : function(arr, $form, options) {

					},
					success : function(data, statusText, xhr, $form) {
						if (data.status) {
							setCookie("refersh_time", 1);
							var admin_url_changed=$("#js-site-admin-url-password").data("changed");
							var message =admin_url_changed?data.info+'<br><span style="color:red;">后台地址已更新(请劳记！)</span>':data.info;

							//添加成功
							Wind.use("artDialog", function() {
								art.dialog({
									id : "succeed",
									icon : "succeed",
									fixed : true,
									lock : true,
									background : "#CCCCCC",
									opacity : 0,
									content : message,
									button : [ {
										name : "{:L('OK')}",
										callback : function() {
											reloadPage(window);
											return true;
										},
										focus : true
									}, {
										name : "{:L('CLOSE')}",
										callback : function() {
											reloadPage(window);
											return true;
										}
									} ]
								});
							});
						} else {
							alert(data.info);
						}
					}
				});
			}
		});
	});
	////-------------------------
</script>
</body>
</html>
